package ch.eureka.provider.controller;

import ch.eureka.provider.api.bean.User;
import ch.eureka.provider.api.facade.HelloService;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 */
@RestController
public class RefactorHelloController implements HelloService {

    /**
     * 接口实现的参数名应该和api的一致，否则接收不了参数的值
     * @param name
     * @return
     */
    @Override
    public String hello4(String name) {
        return "providerService return : " + name;
    }

    @Override
    public User hello5(String name, Integer age) {
        return new User(age, name);
    }

    @Override
    public String hello6(User user) {
        return "providerService return : " + user.getName() + " : " + user.getAge();
    }

}
